package day15.LX;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class Lian01 {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress address = InetAddress.getByName("bigtong");
        String hostName = address.getHostName();
        System.out.println("主机名为"+hostName);
        String ip = address.getHostAddress();
        System.out.println("ip为"+ip);

    }
}
